/**
 * Copyright 2018 Google LLC. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * =============================================================================
 */

html, body {
  background: #2a2a2a;
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
}
body {
  display: flex;
  flex-direction: column;
}
button:focus {
  outline: 0;
}

/** Page header. **/
header {
  background-color: #ef6c00;
  border-bottom: solid 1px rgba(0,0,0,0.4);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  color: rgba(255, 255, 255, 0.7);
  font-size: 30px;
  font-weight: 300;
  line-height: 1.45em;
  overflow: hidden;
  padding: 20px 0;
  position: relative;
  text-align: center;
  -webkit-font-smoothing: antialiased;
}
header b {
  color: rgba(255, 255, 255, 1);
  font-weight: 400;
}

/** Loading message. */
#status {
  color: #f8f8f8;
  font-weight: 300;
  margin: 12px 0;
  text-align: center;
}

/* Rules for the pacman game. */
#pacman-container {
  background: black;
  padding: 25px 0 40px;
}
#logo {
  background: url('https://storage.googleapis.com/tfjs-examples/assets/webcam-transfer-learning/bck.png');
  background-repeat: no-repeat;
  background-position-y: -5px;
  margin: 0 auto;
  position: relative;
  transform: scale(1.2);
  width: 554px;
}
#logo #pcm-c {
  border-top: none;
  margin: 0 auto;
  position: relative;
  top: 20px;
}
#logo-l {
  background: #990;
  display: none;
  height: 2px;
  left: 177px;
  overflow: hidden;
  position: absolute;
  top: 157px;
  width: 200px;
}
#logo-b{
  background: #ff0;
  height: 8px;
  left: 0;
  position: absolute;
  width: 0;
}

/** Controls. **/
.controller-panels {
  display: flex;
  flex-direction: row;
  margin: 9px auto 0;
}
.panel {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  flex-shrink: 0;
}
.panel:first-child {
  border-right: 1px dashed #565656;
  padding: 0 22px 0 13px;
  width: 396px;
}
.panel:last-child {
  padding: 0 9px 0 22px;
  width: 353px;
}
.panel-row {
  display: flex;
  flex-direction: row;
}
.panel-cell {
  align-items: center;
  display: flex;
  flex-direction: column;
  flex-grow: 0;
  justify-content: center;
  position: relative;
}
.panel-cell-fill {
  flex-grow: 1;
}
.panel-cell p {
  color: #8b8b8b;
  font-size: 10px;
  margin: 0;
  padding: 0;
  text-align: center;
}
.controller-panels button {
  background: none;
  border: none;
  box-sizing: border-box;
  cursor: pointer;
  margin: 0;
  padding: 0;
}
#train-status {
  width: 124px;
}

/** Training panel. **/
.big-buttons {
  justify-content: space-between;
}
.big-buttons button {
  align-items: center;
  display: flex;
  flex-direction: row;
}
.big-buttons button span {
  border-bottom: 2px solid #484848;
  border-top: 2px solid #484848;
  color: #aaa;
  display: inline-block;
  font-size: 18px;
  font-weight: 500;
  padding: 9px 11px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.params-webcam-row {
  align-items: flex-start;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin-top: 35px;
}
.webcam-box-outer {
  background: black;
  border: 1px solid #585858;
  border-radius: 4px;
  box-sizing: border-box;
  display: inline-block;
  padding: 9px;
}
.webcam-box-inner {
  border: 1px solid #585858;
  border-radius: 4px;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  overflow: hidden;
  width: 160px;
}
#webcam {
  height: 160px;
  transform: scaleX(-1);
}
.hyper-params {
  display: flex;
  flex-direction: column;
  margin-left: 12px;
}
.dropdown {
  flex-direction: column;
  width: 110px;
  margin-bottom: 10px;
}
.dropdown label {
  color: #777;
  font-size: 11px;
  display: block;
  font-weight: 300;
  line-height: 1;
}
.dropdown .select {
  position: relative;
}
.dropdown .select select {
  -webkit-appearance: none;
  -moz-appearance: none;
  background: none;
  border: none;
  border-bottom: solid 1px #313131;
  border-radius: 0;
  color: #c9c9c9;
  display: block;
  font-size: 12px;
  outline: none;
  padding: 6px 0;
  width: 100%;
}
.dropdown .select::after {
  content: "arrow_drop_down";
  color: #999;
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 18px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  position: absolute;
  right: 0;
  top: 6px;
  pointer-events: none;
}

/** Joystick panel. **/
.joystick-panel {
  margin-top: 13px;
}
.panel-cell .help-text {
  font-size: 10px;
  font-style: italic;
  left: 0;
  line-height: 1.1;
  margin: 0;
  padding: 0;
  text-align: left;
  top: 0;
  position: absolute;
}
.panel-row-top .panel-cell-left {
  background: url("./images/pointer.svg");
  background-repeat: no-repeat;
  background-size: 38%;
  background-position: 98% 46%;
}
.panel-row-middle .panel-cell {
  height: 132px;
}
.thumb-box {
  display: inline-block;
}
.panel-row-middle .thumb-box {
  margin-top: 18px;
}
.thumb-box-outer {
  background: black;
  border: 1px solid #585858;
  border-radius: 4px;
  box-sizing: border-box;
  display: inline-block;
  padding: 9px;
  position: relative;
  transition: box-shadow 0.3s;
}
[data-active="up"] .panel-row-top .thumb-box-outer,
[data-active="down"] .panel-row-bottom .thumb-box-outer,
[data-active="left"] .panel-cell-left .thumb-box-outer,
[data-active="right"] .panel-cell-right .thumb-box-outer {
  box-shadow: 0 0 4px 4px #ffaa00;
}
.thumb-box-inner {
  border: 1px solid #585858;
  border-radius: 4px;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  overflow: hidden;
  width: 66px;
}
.thumb {
  height: 66px;
  transform: scaleX(-1);
}
.thumb-box-outer .record-button {
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
}
.thumb-box-outer .record-button span {
  background: #111;
  border: 1px solid #585858;
  border-radius: 3px;
  bottom: 9px;
  color: #f8f8f8;
  display: block;
  font-size: 8px;
  left: 9px;
  position: absolute;
  right: 9px;
  opacity: 0.5;
}

/** Footer. **/
#copyright {
  color: #f8f8f8;
  font-weight: 300;
  margin: 12px 0;
  text-align: center;
}

#no-webcam {
  display: none;
  text-align: center;
  font-size: 30px;
  color: white;
  padding: 30px;
  line-height: 30px;
}
